﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Gnosis.Babel;

namespace Gnosis.SQLite.Columns
{
    public class TextColumn
        : ColumnDefinition
    {
        public TextColumn(ColumnName name)
            : base(name, TypeName.Text, new List<IColumnConstraint>())
        {
        }

        public TextColumn CollateBinary
        {
            get
            {
                AddChild(ColumnCollate.Binary());
                return this;
            }
        }

        public TextColumn CollateCaseInsensitive
        {
            get
            {
                AddChild(ColumnCollate.CaseInsensitive());
                return this;
            }
        }

        public TextColumn CollateRightTrim
        {
            get
            {
                AddChild(ColumnCollate.RightTrim());
                return this;
            }
        }

        public TextColumn NotNull
        {
            get
            {
                AddChild(new ColumnNotNull());
                return this;
            }
        }

        public TextColumn Default(IReal value)
        {
            AddChild(new ColumnDefault(value));
            return this;
        }
    }
}
